package net.shopxx.dao.impl;


import net.shopxx.bean.Pager;
import net.shopxx.bean.Pager.OrderType;
import net.shopxx.dao.IndexfloorDao;
import net.shopxx.entity.Indexfloor;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.stereotype.Repository;

/**
 * Dao实现类 - 首页楼层
 */

@Repository
public class IndexfloorDaoImpl extends BaseDaoImpl<Indexfloor, String> implements IndexfloorDao {

 // 根据orderList排序
    @Override
    public Pager findByPager(Pager pager, DetachedCriteria detachedCriteria) {
        if (pager == null) {
            pager = new Pager();
           
        }
        pager.setOrderBy("orderList");
        pager.setOrderType(OrderType.asc);
        return super.findByPager(pager, detachedCriteria);
    }

    // 根据orderList排序
    @Override
    public Pager findByPager(Pager pager) {
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Indexfloor.class);
        return this.findByPager(pager, detachedCriteria);
    }

}